package com.thread.book.book2;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

public class Book07 {

    public static void main(String[] args) throws InterruptedException {
        Book07 book07 = new Book07();
        new Thread(() -> {
            try {
                synchronized (book07) {
                    book07.wait();
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("--------------");

        }).start();
        TimeUnit.SECONDS.sleep(2);
        synchronized (book07) {
            book07.notify();
        }
    }
}
